find s algorithm description